package swa2.icecream.factory;

import swa2.icecream.IceCream;
import swa2.icecream.ItalianIceCream;
import swa2.icecream.decorator.ItalianCherrySauce;
import swa2.icecream.decorator.ItalianChocolateDip;

public class ItalianIceCreamFactory extends AbstractIceCreamFactory
{
	@Override
	public void createIceCream() 
	{
		if(icecream != null)
			return;
		
		IceCream ic = new ItalianIceCream();
		
		for(; chocolate > 0; chocolate--)
			ic = new ItalianChocolateDip(ic);
		
		for(; cherry > 0; cherry--)
			ic = new ItalianCherrySauce(ic);
		
		icecream = ic;
	}
}

